package com.n9.qq.android;

import java.util.ArrayList;
import java.util.List;
import java.util.Random;

/**
 * @author ice
 * @since 2019/3/25 16:09
 */
public class ServerAddrUtils {
    private static List<Addr> addrs = new ArrayList<>(0);
    private static int index;

    static {
//        addrs.add(new Addr("101.227.169.214", 443));
//        addrs.add(new Addr("180.163.21.111", 443));
//        addrs.add(new Addr("61.151.166.159", 14000));//error
        addrs.add(new Addr("180.102.110.114", 14000));
//        addrs.add(new Addr("61.129.6.104", 443));

        index = new Random().nextInt(100)%addrs.size();
    }

    public static class Addr {
        String host;
        int port;

        public Addr(String host, int port) {
            this.host = host;
            this.port = port;
        }

        public String getHost() {
            return host;
        }

        public int getPort() {
            return port;
        }
    }
    public static Addr next() {
        Addr addr = addrs.get(index++);
        index = index%addrs.size();
        return addr;
    }
}
